﻿using UnityEngine;
using System.Collections;

public class generateObstacle : MonoBehaviour {
	//a reference to our obstacle prefab
	public Transform prefab;
	//where our obstacle should be generated
	public Vector3 obstaclePosition;
	//where in the game world we click.
	public Vector3 myMousePosition;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		if (Input.GetMouseButtonDown(1)){
			myMousePosition = Input.mousePosition;
			myMousePosition.z = 10f;
			obstaclePosition = Camera.main.ScreenToWorldPoint(new Vector3(myMousePosition.x, myMousePosition.y, myMousePosition.z));
			//Instantiate(prefab, obstaclePosition, Quaternion.identity);
		}
	}
}
